﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SlamDunk.CMS.Model
{
    /// <summary>
    /// Link实体类（手写部分）
    /// </summary>
    public partial class Link
    {
        #region 01.方法——转换为视图模型对象
        /// <summary>
        /// 转换为视图模型对象方法
        /// </summary>
        /// <returns>视图模型对象</returns>
        public Model.LinkView ToViewModel()
        {
            return new Model.LinkView()
            {
                Id = this.Id,
                CategoryId = this.CategoryId,
                CategoryName = this.LinkCategory.CategoryName,
                LinkName = this.LinkName,
                Url = this.Url,
                Description = this.Description,
                Sort = this.Sort,
                ImagePath = this.ImagePath,
                AddTime = this.AddTime.ToString("yyyy-MM-dd HH:mm:ss"),
            };
        }
        #endregion
    }
}
